#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e5+5;
int n, a[MAXN];

bool cmp(int a, int b){
    return a > b;
}

int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin >> n;
    for (int i = 1; i<=n; i++){
        cin >> a[i];
    }
    sort(a+1, a+1+n, cmp);

    int ans = 0, pos = 0, cnt = 0;

    for (int i = pos+2; i<=n+1; i++){
        if(a[i] != a[i-1]){
            ans = max(ans, i-1-pos);
            pos = i-1;
        }
    }

    cout << ans;
    return 0;
}
